import request from '@/utils/request'

// 获取图片list
export function getImage(params) {
  return request({
    url: '/sys/background/images',
    method: 'get',
    params:params
  })
}

//新增
export function addImage(data) {
  return request({
    url: '/sys/background',
    method: 'post',
    data:data
  })
}

//删除
export function delImage(id) {
  return request({
    url: '/sys/background/'+id,
    method: 'delete',
  })
}

//修改
export function updateImage(data){
  return request({
    url:'/sys/background',
    method:'put',
    data:data
  })
}
//查询详细图片title
export function getImageTitle(id){
  return request({
    url:'/sys/background/' + id,
    method:'get',
  })
}

export function seeduploadImg(img) {
  const formData = new FormData()
  formData.append('img', img)
  return request({
    url: '/sys/background/seedupload',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
    data: formData
  })
}